package controllers;

import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.LinkedList;
import java.util.List;

import org.codehaus.groovy.tools.shell.commands.SaveCommand;


import play.*;
import play.jobs.*;
import play.test.*;
import models.*;

@OnApplicationStart
public class Bootstrap extends Job {
	/**
     * This method calls the initData(); method
     * @author mohammed mattr
     
     */
	 public void doJob() {
		 initData();
 }
	 /**
      * This method initialize the data like Admin and users 
      * @author mohammed mattr
      
      */
	  public static void initData() {
		  
		  if(RegisteredUser.count()==0){

		 RegisteredUser Admin1= new RegisteredUser("Admin1", "Admin1@gmail.com","123",true).save();
		 RegisteredUser user1 = new RegisteredUser("user1", "user1@gmail.com","123",false).save();
		 RegisteredUser user2  = new RegisteredUser("user2", "user2@gmail.com","123",false).save();
	 }
	  
	}
}
